package appita.general;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import appita.parser.Parser;

public class MainActivity extends Activity {

	private Button grid;
	private Button categories;
	private Button test;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		// Mi creo il json
		Lettera.getInstance().setArrayCompleto(
				Parser.getInstance().createArrayJson(this, R.raw.parole));

		grid = (Button) this.findViewById(R.id.grid);
		categories = (Button) this.findViewById(R.id.categories);
		test = (Button) this.findViewById(R.id.exercise);

		grid.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent intent = new Intent(MainActivity.this, LivelloUno.class);
				startActivity(intent);

			}
		});

		categories.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent intent = new Intent(MainActivity.this, Categories.class);
				startActivity(intent);

			}
		});

		test.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent intent = new Intent(MainActivity.this,
						Esercitazioni.class);
				String pkg = getPackageName();
				intent.putExtra(".Punteggio", String.valueOf(0));
				intent.putExtra(".Contatore", String.valueOf(0));
				startActivity(intent);
			}
		});

	}
}